package a1_graph_lib;

import java.util.ArrayList;



public class AIGraphCounter{
	static private AIGraph graph;
	
	static private int zugriffe_graph;
	static private int zugriffe_lesen_vertices;
	static private int zugriffe_aendern_vertices;
	static private int zugriffe_lesen_edges;
	static private int zugriffe_aendern_edges;
	static private int zugriffe_lesen_attribute;
	static private int zugriffe_aendern_attribute;
	
	
	
	public AIGraphCounter(AIGraph graph){
		AIGraphCounter.graph = graph;
		 zugriffe_graph = 0;
		 zugriffe_lesen_vertices = 0;
		 zugriffe_aendern_vertices = 0;
		 zugriffe_lesen_edges = 0;
		 zugriffe_aendern_edges = 0;
		 zugriffe_lesen_attribute = 0;
		 zugriffe_aendern_attribute = 0;
	}
	
	public AIGraph getAIGraph() {return graph;}
	public int getZugriffeGraph() {
		zugriffe_graph = zugriffe_graph + zugriffe_lesen_vertices + zugriffe_aendern_vertices + zugriffe_lesen_edges + 
				zugriffe_aendern_edges + zugriffe_lesen_attribute + zugriffe_aendern_attribute;	
		return zugriffe_graph;
	}
	public int getZugriffeLesenVerticis() {return zugriffe_lesen_vertices;}
	public int getZugriffeAendernVerticis() {return zugriffe_aendern_vertices;}
	public int getZugriffeLesenEdges() {return zugriffe_lesen_edges;}
	public int getZugriffeAendernedges() {return zugriffe_aendern_edges;}
	public int getZugriffeLesenAtribute() {return zugriffe_lesen_attribute;}
	public int getZugriffeAendernAtribute() {return zugriffe_aendern_attribute;}
	
	public int addVertex(String newItem) {
		zugriffe_aendern_vertices++;
		return graph.addVertex(newItem);
	}

	public boolean deleteVertex(int v_id) {
		zugriffe_aendern_vertices++;
		return graph.deleteVertex(v_id);
	}

	public int addEdgeU(int v1, int v2) {
		zugriffe_aendern_edges++;
		return graph.addEdgeU(v1, v2);
	}

	public int addEdgeD(int v1, int v2) {
		zugriffe_aendern_edges++;
		return graph.addEdgeD(v1, v2);
	}

	public boolean deleteEdge(int v1, int v2) {
		zugriffe_aendern_edges++;
		return graph.deleteEdge(v1, v2);
	}

 boolean isEmpty() {
		zugriffe_graph++;
		return graph.isEmpty();
	}

	public int getSource(int edge) {
		zugriffe_lesen_edges++;
		return graph.getSource(edge);
	}

	public int getTarget(int edge) {
		zugriffe_lesen_edges++;
		return graph.getTarget(edge);
	}

	public ArrayList<Integer> getIncident(int vertex) {
		zugriffe_lesen_vertices++;
		return graph.getIncident(vertex);
	}

	public ArrayList<Integer> getAdjacent(int vertex) {
		zugriffe_lesen_vertices++;
		return graph.getAdjacent(vertex);
	}

	public ArrayList<Integer> getVertices() {
		zugriffe_lesen_vertices++;
		return graph.getVertices();
	}

	public ArrayList<Integer> getEdges() {
		zugriffe_lesen_edges++;
		return graph.getEdges();
	}

	public int getValE(int edge, String attr) {
		zugriffe_lesen_attribute++;
		return graph.getValE(edge, attr);
	}

	public int getValV(int vertex, String attr) {
		zugriffe_lesen_attribute++;
		return graph.getValV(vertex, attr);	}

	public String getStrE(int edge, String attr) {
		zugriffe_lesen_attribute++;
		return graph.getStrE(edge, attr);
	}

	public String getStrV(int vertex, String attr) {
		zugriffe_lesen_attribute++;
		return graph.getStrV(vertex, attr);
	}

	public ArrayList<String> getAttrE(int edge) {
		zugriffe_lesen_attribute++;
		return graph.getAttrE(edge);
	}

	public ArrayList<String> getAttrV(int vertex) {
		zugriffe_lesen_attribute++;
		return graph.getAttrV(vertex);
	}

	public boolean setValE(int edge, String attr, int val) {
		zugriffe_aendern_attribute++;
		return graph.setValE(edge, attr, val);
	}

	public boolean setValV(int vertex, String attr, int val) {
		zugriffe_aendern_attribute++;
		return graph.setValV(vertex, attr, val);
	}

	public boolean setStrE(int edge, String attr, String val) {
		zugriffe_aendern_attribute++;
		return graph.setStrE(edge, attr, val);
	}

	public boolean setStrV(int vertex, String attr, String val) {
		zugriffe_aendern_attribute++;
		return graph.setStrV(vertex, attr, val);
	}

	
}
